package piece1.chapter5;

import java.util.Scanner;

public class Factorial {

    /**
     * @param args
     */
    public static void main(String[] args) {
	// TODO 自动生成的方法存根
	Scanner inScanner = new Scanner(System.in);
	Long value = inScanner.nextLong();
	recursion r = new recursion();
	System.out.println(r.factorial(value));
	inScanner.close();
    }

    static class recursion {

	public Long factorial(Long factorial) {
	    if (factorial == 0.0) {
		return (long) 1;
	    }

	    else {
		return factorial * factorial(factorial - 1);
	    }

	}

    }
}
